/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 有点呆
 * Date: 2024-04-06
 * Time: 12:06
 */


import java.util.Scanner;
public class Sum {
    //存在连续三个奇数的数组
    public static boolean three(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 != 0) {
                count++;
                if (count == 3) {
                    return true;
                }
            } else {
                count = 0;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组里的内容：");
        int n = 5;
        int[] arr = new int[n];
        for (int k = 0; k < n; k++) {
            arr[k] = sc.nextInt();
        }
        System.out.println(three(arr));
    }
    //查找多数元素
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组里的内容：");
        int n = 4;
        int count = 0;
        int[] arr = new int[n];
        for(int k = 0; k<n; k++){
            arr[k] = sc.nextInt();
        }
        int i = 0;
        int X = 0;
        for(i = 0; i<arr.length; i++){
                X = arr[i];
            for(int j = 0;j<arr.length; j++){
                if(arr[j]==X){
                    count++;
                }
            }
        }
        if(count >= 2){
            System.out.println(X);
        }
    }
    //只出现一次的数字
    public static void main2(String[] args) {
        int[] a = new int[]{2,2,1};
        int result = 0;
        for(int i = 0; i<a.length; i++){
            result ^= a[i];
        }
        System.out.println(result);
    }
    //求两数之和
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组里的内容：");
        int n = 4;
        int[] array = new int[n];
        for(int k = 0; k<n; k++){
            array[k] = sc.nextInt();
        }
        System.out.println("请输入目标求和的数字：");
        int target = sc.nextInt();
        for(int i = 0; i < array.length; i++){
            for(int j = 0; j < array.length; j++){
                if(array[i] + array[j] == target){
                    System.out.print("["+i+","+j+"]");
                }
            }
        }
    }
}
